﻿@using System.Threading.Tasks
@using Pgpg.Web.Areas.Admin.Models.Languages
@using Pgpg.Web.Areas.Admin.Startup
@using Pgpg.Web.Startup
@model LanguageTextsViewModel
@{
    ViewBag.CurrentPageName = AdminPageNames.Common.Languages;
}
@section Styles
{
    <environment names="Development">
        <link rel="stylesheet" href="~/view-resources/Areas/Admin/Views/Languages/Texts.css" asp-append-version="true" />
    </environment>

    <environment names="Staging,Production">
        <link rel="stylesheet" href="~/view-resources/Areas/Admin/Views/Languages/Texts.min.css" asp-append-version="true" />
    </environment>
}
@section Scripts
{
    <environment names="Development">
        <script src="~/view-resources/Areas/Admin/Views/Languages/_EditTextModal.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/Admin/Views/Languages/Texts.js" asp-append-version="true"></script>
    </environment>

    <environment names="Staging,Production">
        <script src="~/view-resources/Areas/Admin/Views/Languages/_EditTextModal.min.js" asp-append-version="true"></script>
        <script src="~/view-resources/Areas/Admin/Views/Languages/Texts.min.js" asp-append-version="true"></script>
    </environment>
}
<div class="row margin-bottom-5">
    <div class="col-xs-6">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("LanguageTexts")</span> <small>@L("LanguageTextsHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-xs-6 text-right">

    </div>
</div>

<div class="portlet light margin-bottom-0">
    <div class="portlet-title portlet-title-filter">
        <div class="inputs inputs-full-width">
            <div class="portlet-input">
                <form id="TextsFilterForm">
                    <div class="row">
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TextBaseLanguageSelectionCombobox">@L("BaseLanguage")</label>
                                <select id="TextBaseLanguageSelectionCombobox" name="BaseLanguage"
                                        class="form-control bs-select"
                                        data-live-search="true">
                                    @foreach (var language in Model.Languages)
                                    {
                                        <option data-icon="@language.Icon" value="@language.Name" selected="@(language.Name==Model.BaseLanguageName)">
                                            <i class="@language.Icon"></i>@language.DisplayName
                                        </option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TextTargetLanguageSelectionCombobox">@L("TargetLanguage")</label>
                                <select id="TextTargetLanguageSelectionCombobox" name="TargetLanguage"
                                        class="form-control bs-select"
                                        data-live-search="true">
                                    @foreach (var language in Model.Languages)
                                    {
                                        <option data-icon="@language.Icon" value="@language.Name" selected="@(language.Name==Model.LanguageName)">
                                            <i class="@language.Icon"></i>@language.DisplayName
                                        </option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TextSourceSelectionCombobox">@L("Source")</label>
                                @Html.DropDownList(
                                    "SourceName",
                                    Model.Sources,
                                    new
                                    {
                                        @class = "form-control selectpicker",
                                        data_live_search = "true",
                                        id = "TextSourceSelectionCombobox"
                                    })
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TargetValueFilterSelectionCombobox">@L("TargetValue")</label>
                                <select id="TargetValueFilterSelectionCombobox" class="form-control bs-select" name="TargetValue">
                                    <option value="ALL" selected="@(Model.TargetValueFilter == "ALL")">@L("All")</option>
                                    <option value="EMPTY" selected="@(Model.TargetValueFilter == "EMPTY")">@L("EmptyOnes")</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="input-group">
                        <input id="TextFilter" value="@Model.FilterText" class="form-control" placeholder="@L("SearchWithThreeDot")" type="text">
                        <span class="input-group-btn">
                            <button id="RefreshTextsButton" class="btn default" type="submit"><i class="icon-refresh"></i> @L("Refresh")</button>
                        </span>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="portlet-body">
        <div id="TextsTable"></div>
    </div>
</div>